/*
 * Copyright (c)  2016, 
 * All rights reserved.
 * SettlementBatch.java 2016-06-23 上午10:22
 */

package com.ueboot.weishop.entity.finance;

import com.ueboot.weishop.entity.IDEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * 描述:每日结算批次
 *
 * @author yangkui create on 2017-09-17.
 * @since 1.0
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "WS_SETTLEMENT_BATCH")
public class SettlementBatch extends IDEntity {

    public static final String STATUS_INI= "待处理";
    public static final String STATUS_IMPORT_END= "数据已入库";
    public static final String STATUS_SUCCESS= "对账成功";
    public static final String STATUS_ERROR= "处理异常";
    public static final String STATUS_FAIL= "对账失败";



    /* 物理主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "WS_SETTLEMENT_BATCH")
    @GenericGenerator(name = "WS_SETTLEMENT_BATCH", strategy = "enhanced-table", parameters = {
            @org.hibernate.annotations.Parameter(name = "table_name", value = "WS_TABLE_SEQUENCE"),
            @org.hibernate.annotations.Parameter(name = "segment_value", value = "WS_SETTLEMENT_BATCH"),
            @org.hibernate.annotations.Parameter(name = "optimizer", value = "pooled") })
    @Column(name = "ID",columnDefinition = "INT(20) COMMENT 'id主键'",length = 20)
    private Long id;

    /**
     * 结算批次号
     */
    @Column(name = "BATCH_NO",columnDefinition = "VARCHAR(40) COMMENT '结算批次号'",length = 40)
    private String batchNo;
    /**
     * 批处理结算日期
     */
    @Column(name = "SETTLE_DATE",columnDefinition = "DATE COMMENT '批处理结算日期'")
    private Date settleDate;

    /**
     * 文件名
     */
    @Column(name = "FILE_NAME",columnDefinition = "VARCHAR(200) COMMENT '文件名'",length = 200)
    private String fileName;
    /**
     * 状态
     */
    @Column(name = "STATUS",columnDefinition = "VARCHAR(40) COMMENT '状态'",length = 40)
    private String status;
    /**
     * 本地订单总数
     */
    @Column(name = "ORDER_COUNT",columnDefinition = "INT(11) COMMENT '本地订单总数'",length = 11)
    private Long orderCount;
    /**
     * 对账结算总数
     */
    @Column(name = "SETTLE_COUNT",columnDefinition = "INT(11) COMMENT '对账结算总数'",length = 11)
    private Long settleCount;
    /**
     * 本地订单总金额(分为单位)
     */
    @Column(name = "ORDER_PRICE",columnDefinition = "INT(11) COMMENT '本地订单总金额(分为单位)'",length = 11)
    private Long orderPrice;
    /**
     * 对账结算总金额(分为单位)
     */
    @Column(name = "SETTLE_PRICE",columnDefinition = "INT(11) COMMENT '对账结算总金额(分为单位)'",length = 11)
    private Long settlePrice;

    /**
     * 对账结算退款总金额(分为单位)
     */
    @Column(name = "SETTLE_REFUND_PRICE",columnDefinition = "INT(11) COMMENT '对账结算退款总金额(分为单位)'",length = 11)
    private Long settleReFundPrice;

    /**
     * 对账结算手续费总金额(分为单位)
     */
    @Column(name = "SETTLE_FEE",columnDefinition = "INT(11) COMMENT '对账结算手续费总金额(分为单位)'",length = 11)
    private Long settleFee;

    /**
     * 执行的次数,超过3次,就不再执行
     */
    @Column(name = "COUNT",columnDefinition = "INT(11) COMMENT '执行的次数,超过3次,就不再执行'",length = 11)
    private Long count;

    /**
     * 手动对账备注
     */
    @Column(name = "REMARK",columnDefinition = "VARCHAR(2000) COMMENT '手动对账备注'",length = 2000)
    private String remark;


}